﻿using UnityEngine;
using System.Collections;

public class PassWordConfirm : PasswordButton {

    void Update()
    {
        if (isEnter)
        {
            TimeCounter += Time.deltaTime; //检测射线进入即开始计时
        }
        if (TimeCounter > PressDownTime)
        {
            PressDown();   //达到时间执行按钮被按下操作
            TimeCounter = 0f;//计时器清零
            isEnter = false;
        }
    }
    /// <summary>
    /// 按下确认，比对密码
    /// </summary>
    void PressDown()
    {
        Roller.GetComponent<PasswordRoate>().CompletedInput();
    }
}
